#ifndef F_CASsiUARTDriverC_h
#define F_CASsiUARTDriverC_h

// ***********************************************************************

// class EDROOMTopContext

// ***********************************************************************



class EDROOMTopContext {

protected:

enum EDROOMCASsiUARTDriverSignal { EDROOMSignalTimeout, EDROOMSignalDestroy, DataReceived, SDataFrame, SSignalFrame };


	friend class CASsiUARTDriver;

	CASsiUARTDriver &EDROOMcomponent;

	CEDROOMMessage * &Msg;

	CEDROOMMessage * &MsgBack;

	//Ports

	CEDROOMInterface & SsiFromComponent;
	CEDROOMIRQInterface & IrqUART;

	enum edroomStateId{I, Listening};

	enum IdTrans{Init, SendToUART, ReceiveFromUART,  EDROOMMEMORIA };

	//Constantes



	//Variables

	bool_t &VUARTError;


	//Pool



	// CONSTRUCTORES

	EDROOMTopContext (CASsiUARTDriver &act, bool_t & EDROOMpVarVUARTError );

	EDROOMTopContext ( EDROOMTopContext &contex );

public:

	bool EDROOMSearchContextTrans(TEDROOMTransId &edroomCurrentTrans);

	void EDROOMNuevoMens () { EDROOMcomponent.EDROOMNewMsg(); }

	// Funciones Definidas por el usuario

	void	FG();

	void	FSendToSensor();

	void	FInit();

	void	FGetCharFromUART();

};

// ***********************************************************************

// class EDROOMTopState

// ***********************************************************************



class EDROOMTopState : public EDROOMTopContext {

protected:



	EDROOMTopContext::edroomStateId edroomCurrentState;

	EDROOMTopContext::edroomStateId edroomNextState;

	//Variables

	bool_t VUARTError;


	//Pools



public:

	// CONSTRUCTOR

	EDROOMTopState (CASsiUARTDriver &act );


	// EDROOMBehaviour**********************************************

	void EDROOMBehaviour();

	// Inicio**********************************************

	void EDROOMInicio();

	// ***********************************************************************

	// SubEstado Inicial 

	// ***********************************************************************



	TEDROOMTransId EDROOMIllegada();

	// ***********************************************************************

	// SubEstado Hoja Listening

	// ***********************************************************************



	TEDROOMTransId EDROOMListeningllegada();

};


#endif
